/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JOrdersBagView.java
 *
 * Created on 2009-11-24, 11:37:22
 */

package cn.ekuma.epos.qkorder.orderbag.view;

import cn.ekuma.epos.datalogic.I_DataLogicERP;
import cn.ekuma.epos.qkorder.JOrdersBag;
import cn.ekuma.epos.qkorder.OrdersEditor;

import com.openbravo.bean.erp.Order;
import com.openbravo.bean.infobean.CustomerInfo;
import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.base.AppView;
import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 *
 * @author Administrator
 */
public class JOrdersBagView extends JOrdersBag{

    
    /** Creates new form JOrdersBagShared */
    public JOrdersBagView(AppView app, OrdersEditor panelOrder,I_DataLogicERP m_dlSales) {
        super(app, panelOrder, m_dlSales);
        initComponents();
    }
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jOpenOrder = new javax.swing.JButton();
        jImpOrder = new javax.swing.JButton();
        jListProducts = new javax.swing.JButton();

        setMinimumSize(new java.awt.Dimension(149, 25));
        setPreferredSize(new java.awt.Dimension(400, 25));
        setLayout(new java.awt.BorderLayout());

        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 1));

        jOpenOrder.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/fileopen.png"))); // NOI18N
        jOpenOrder.setFocusPainted(false);
        jOpenOrder.setFocusable(false);
        jOpenOrder.setPreferredSize(new java.awt.Dimension(35, 25));
        jOpenOrder.setRequestFocusEnabled(false);
        jOpenOrder.setVerifyInputWhenFocusTarget(false);
        jPanel1.add(jOpenOrder);

        jImpOrder.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/redo16.png"))); // NOI18N
        jImpOrder.setFocusable(false);
        jImpOrder.setPreferredSize(new java.awt.Dimension(35, 25));
        jImpOrder.setRequestFocusEnabled(false);
        jImpOrder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jImpOrderActionPerformed(evt);
            }
        });
        jPanel1.add(jImpOrder);

        jListProducts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/unsortedList.png"))); // NOI18N
        jListProducts.setFocusPainted(false);
        jListProducts.setFocusable(false);
        jListProducts.setMargin(new java.awt.Insets(8, 14, 8, 14));
        jListProducts.setPreferredSize(new java.awt.Dimension(35, 25));
        jListProducts.setRequestFocusEnabled(false);
        jListProducts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jListProductsActionPerformed(evt);
            }
        });
        jPanel1.add(jListProducts);

        add(jPanel1, java.awt.BorderLayout.LINE_START);
    }// </editor-fold>//GEN-END:initComponents

    private void jImpOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jImpOrderActionPerformed
        
}//GEN-LAST:event_jImpOrderActionPerformed

    private void jListProductsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jListProductsActionPerformed
        
}//GEN-LAST:event_jListProductsActionPerformed

    @Override
    public void activate() {
    }

    @Override
    public boolean deactivate() {
       return true;
    }

    @Override
    public void deleteOrder() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void newOrder() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    
    
    @Override
	public void newOrder(CustomerInfo obj) {
	}

	@Override
    public JComponent getBagComponent() {
    	return this;
    }

    @Override
    public JComponent getNullComponent() {
    	return new JPanel();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jImpOrder;
    private javax.swing.JButton jListProducts;
    private javax.swing.JButton jOpenOrder;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
	@Override
	public void setOrderEditAble(boolean editAble) {
		// TODO Auto-generated method stub
	}


	@Override
	public void setActiveOrder(Order order, boolean isEditAble)
			throws BasicException {
		 m_panelOrder.setActiveOrder(order, null,isEditAble);	
	}


	@Override
	public void flushOrder() {
		// TODO Auto-generated method stub
		
	}

}
